<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>

<div class="wrapper wrapper-content animated fadeInRight">
	<jsp:include page="search.jsp"></jsp:include>
	<div class="row">
		<div class="col-lg-12">
			<div class="ibox ">
				<div class="ibox-title">
					<h4>采购计划列表</h4>
					<div class="ibox-tools">
						<button id="searchButton" class="btn btn-default btn-sm btn-notcontrol" type="button"><i class="fa fa-search"></i>&nbsp;&nbsp;展开查询</button>
					</div>
				</div>
				<div class="ibox-content border-bottom" style="padding-bottom: 0;">
					<div class="table-responsive">
						<table class="table table-striped table-hover table-bordered border-top">
							<thead>
								<tr>
									<th width="5%">序号</th>
									<th>编号</th>
									<th>计划类型</th>
									<th>提交时间</th>
									<th>状态</th>
									<th width="10%">操作</th>
								</tr>
							</thead>
							<tbody>
								<c:forEach items="${requestScope.list}" var="data" varStatus="index">
									<tr>
										<td>${index.count}</td>
										<td>${data.code}</td>
										<td>${requestScope.typeMap[data.type]}</td>
										<td><fmt:formatDate value="${data.createTime}" pattern="yyyy-MM-dd"/></td>
										<td>${requestScope.statusMap[data.status]}</td>
										<td>
											<div class="btn-group">
												<button class="btn-white btn btn-xs btn-notcontrol" onclick="showAudit('${data.code}')"><i class="fa fa-eye"></i>&nbsp;查看</button>&nbsp;
											</div>
										</td>
									</tr>
								</c:forEach>
							</tbody>
							<tfoot>
								<jsp:include page="../../../common/pages.jsp"></jsp:include>
							</tfoot>
						</table>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
<script src="js/listPage.js"></script>
<script>
	// 查看
	function showAudit(id) {
		window.location.href="web/purchasingAudit/detail?code=" + id;
	}

	//跳转页面
	function gotoPage(page){
		let data = {};
		data.page = page;
		data.code = $("#code").val();
		data.type = $("#type").val();
		data.status = $("#status").val();
		var pageNumber = ${requestScope.pages.pageNumber};
		var currentPage = ${requestScope.pages.page};
		//首页和尾页无需跳转
		if((currentPage==1&&page==1)||(currentPage==pageNumber&&page==pageNumber)){

		} else {
			getMainTab(data);
		}
	}
</script>